import { Logger } from '@nestjs/common';
import { Options } from '@mikro-orm/core';

const logger = new Logger('MikroORM');

// const config: Options = {
//   dbName: 'typecho',
//   user:'typecho',
//   password:'88888888',
//   type: 'mysql',
//   port: 3306,
// };

const config: Options = {
  dbName: 'zp_apesk_net',
  user: 'zp_apesk_net',
  password: '88888888',
  type: 'mysql',
  host: '192.168.1.6',
  port: 3306,
  entitiesTs: ['./src/databases/entities'],
  entities: ['./dist/databases/entities'],
  discovery: {
    // warnWhenNoEntities:false
  },
  //   seeder: {
  //     path: './seeders', // path to the folder with seeders
  //     pathTs: './seeders', // path to the folder with TS seeders (if used, we should put path to compiled files in `path`)
  //     defaultSeeder: 'DatabaseSeeder', // default seeder class name
  //     glob: '!(*.d).{js,ts}', // how to match seeder files (all .js and .ts files, but not .d.ts)
  //     emit: 'ts', // seeder generation mode
  //     //fileName: (className: string) => className, // seeder file naming convention
  //   }
};

export default config;

// @Module({
//     imports: [
//     MikroOrmModule.forRoot({
//         discovery: {
//             // we need to disable validation for no entities
//             warnWhenNoEntities: false,
//         },
//         contextName:'zp',
//         dbName: 'zp_apesk_net',
//         user:'zp_apesk_net',
//         password:'88888888',
//         type: 'mysql',
//         port: 3306,
//         allowGlobalContext:true,
//         highlighter: new SqlHighlighter(),
//         entityGenerator:{
//             entitySchema: true,
//             bidirectionalRelations: true,
//             identifiedReferences: true,
//             esmImport: true,
//         }
//         //debug: true,
//         //logger: logger.log.bind(logger),
//         })
//     ]
//   })

// export class AppModule {}
